package com;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.EntityNotFoundException;
import com.google.appengine.api.datastore.KeyFactory;
import com.google.appengine.api.datastore.Query;
import com.google.appengine.api.datastore.Query.FilterOperator;

import struct.SellerInfo;
import struct.CommentInfo;
import java.util.ArrayList;
import database.Helper;
@SuppressWarnings("serial")
public class SellerInfoServlet extends HttpServlet 
{//client-server style (get input from client, then redirect output)
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException, ServletException 
	{
		String username = req.getParameter("username");
		String seller = req.getParameter("seller");
		

		
		
		req.setAttribute("username", username);
		req.setAttribute("sellerInfo", Helper.GetSellerInfo(seller));
		req.setAttribute("commentInfo", Helper.GetCommentInfo(seller));
		
		req.getRequestDispatcher("sellerInfo.jsp").forward(req, resp);
	}
	
}
